# -*- encoding:utf-8 -*-
from flask import Flask, Blueprint
from flask_script import Manager
from datetime import timedelta
from config import config
import sys

app = Flask(__name__)
for k, v in config.items():
    app.config['APP_' + k] = v

app.debug = app.config['APP_IS_DEBUG'] or False
app.secret_key = app.config['APP_SECRET_KEY']

app.permanent_session_lifetime = timedelta(minutes=30)
manager = Manager(app)

if sys.argv[0] != 'task.py':
    # import route rule
    import kernel
